<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<?php echo $_BASE_DIR?>css_v1/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $_BASE_DIR?>css_v1/select.css" rel="stylesheet" type="text/css" />
    <!-- tips -->
    <link type="text/css" href="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.tooltip.css" rel="stylesheet">
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.position.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.tooltip.js"></script>
    <!--<script type="text/javascript" src="<?php /*echo $_BASE_DIR*/?>js_v1/jquery.js"></script>-->
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/select-ui.min.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>javascripts/commond.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>baidu_editor/ueditor.config.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.datetimepicker.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.DatePicker.js"></script>
<!-- 编辑器源码文件 -->
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>baidu_editor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="<?php echo $_BASE_DIR?>baidu_editor/lang/zh-cn/zh-cn.js"></script>
<link href="<?php echo $_BASE_DIR?>uploadify/css/uploadify.css" rel="stylesheet" type="text/css" />

<style type="text/css">
#header {
  height: 85px
}

#leftside,#container,#splitBar,#splitBarProxy {
  top: 90px
}
.forminfo li label {
    width: 150px;

}
</style>
<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
    width : 345       
  });
  $(".select2").uedSelect({
    width : 167  
  });
  $(".select3").uedSelect({
    width : 110
  });

    //启动tip功能
    $( document ).tooltip({
        position: { my: "left+15 center", at: "right center" }
    });
});
</script>
<script src="<?php echo $_BASE_DIR?>javascripts/jquery.ocupload.min.js"
  type="text/javascript"></script>


  
<script type="text/javascript">
function ajaxpost(form)
{
  var data = $(form).serialize();
  $.post(form.action, data,function(result){
    result =  eval("("+result+")");
    alert(result.message);
    if( result.forwardUrl !== 'null' && result.forwardUrl !== null )
    {
      window.location.href = result.forwardUrl;
    }
    });
  return false;
}
</script>

</head>

<body>

  <div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="<?php echo url("leftmenu/bottom")?>">首页</a></li>
    <li><a href="/">视频管理</a></li>
    </ul>
    </div>
    <div class="formbody">
    <div id="usual1" class="usual">
    <div id="tab1" class="tabson">
    <ul class="forminfo">

    <form action="<?php echo url("video/add")?>" method="post" onsubmit="return ajaxpost(this)">
        <?php
              $viplevel=viplevel::find('acct_id = ?',$_SESSION['acct']['id'])->setColumns('id,title')->getAll();
              if(!empty($video->id)){
                $viparr= explode(",", $video->free_viplevelids);
              }else{
                $video = new video;
                $viparr= array();
              }
              $classList = educategory::getallclasslist($_SESSION['acct']['id']);
              $tagList = videotag::gettaglist($_SESSION['acct']['id']);
              $upload_url = url('admin::interface/uploadeditor');
              $host = Helper_Common::getRequestHost();
              $teacher = teacher::getselectlist($_SESSION['acct']['id']);
        ?>


        <input type="hidden" value="<?php echo $video->id ?>" name="id" />
        <li>
        <label>视频标题</label>
        <input type="text" title="视频标题" class="dfinput" style="width:200px;" value="<?php echo $video->title ?>" name="title" />
        </li>


        <li>
          <label>封面图片 750*420</label>
          <?php echo Q::control('uploadbutton','pic_url',array('value'=>$video->pic_url,'title'=>'封面图片'))?>
        </li>

        
        <li>
        <label>分类</label>
        <div class="vocation">
          <select name="class_id" class="select2" style="width: 200px" title="分类">
          <?php foreach($classList as $k => $v){  ?>
          <option value="<?php echo($k)?>" <?php echo $video->class_id == $k ? 'selected':''?>><?php echo $v?></option>
          <?php } ?>
          </select>
          </div>
        </li>
        <li>

        <li>
        <label>标签</label>
        <div class="vocation">
          <select name="tag_id" class="select3" title="分类">
          <?php foreach($tagList as $k => $v){ ?>
          <option value="<?php echo($k)?>" <?php echo $video->tag_id == $k ? 'selected':''?>><?php echo $v?></option>
          <?php } ?>
          </select>
          </div>
        </li>

        <li>
        <label>多媒体类型</label>
        <div class="vocation">
          <select name="style" class="select3" title="多媒体类型">
          <option value="0" <?php echo $video->style == 0 ? 'selected':''?>>视频</option>
          <option value="1" <?php echo $video->style == 1 ? 'selected':''?>>音频</option>
          <option value="2" <?php echo $video->style == 2 ? 'selected':''?>>文章</option>
          <option value="3" <?php echo $video->style == 3 ? 'selected':''?>>直播</option>
          </select>
          </div>
        </li>

        <li>
        <label>讲师</label>
        <div class="vocation">
          <select name="teacher_id" class="select3" title="讲师">
          <option value="0" <?php echo $video->teacher_id == 0 ? 'selected':''?>>请选择</option>
          <?php 
              foreach ($teacher as $key => $value) {
          ?>
              <option value="<?php echo $key ?>" <?php echo $video->teacher_id == $key ? 'selected':''?>><?php echo $value ?></option>

          <?php
              }
          ?>
          
          </select>
          </div>
        </li>

        <li>
        <label>视频来源</label>
        <div class="vocation">
          <select name="type" class="select3" title="视频来源">
          <option value="1" <?php echo $video->type == 1 ? 'selected':''?>>腾讯视频</option>
          <option value="0" <?php echo $video->type == 0 ? 'selected':''?>>其他</option>
          </select>
          </div>
        </li>
        
        <li>
        <label>直播地址</label>
        <input type="text" title="直播地址" class="dfinput" style="width:200px;" value="<?php echo $video->video_url ?>" name="video_url" />
        </li>

        <li>
          <label>直播回看地址</label>
          <input type="text" title="直播回看地址" class="dfinput" style="width:200px;" value="<?php echo $video->return_url ?>" name="return_url" />

        </li>

        <li>
        <label>开课时间（仅直播有效）</label>
        <input type="datetime-local" title="开课时间（仅直播有效）" class="dfinput" style="width:200px;" value="<?php echo str_replace("CS", '',date("Y-m-dTH:i",$video->opening_time)) ?>" name="opening_time" />
        </li>

        <li>
        <label>结束课时间（仅直播有效）</label>
        <input type="datetime-local" title="结束课时间（仅直播有效）" class="dfinput" style="width:200px;" value="<?php echo str_replace("CS", '',date("Y-m-dTH:i",$video->end_time)) ?>" name="end_time" />
        </li>

        <li>
        <label>直播摄制视频源</label>
        <input type="text" title="直播摄制视频源" class="dfinput" style="width:200px;" value="<?php echo $video->live_url ?>" name="live_url" />
        </li>

        <li>
        <label>是否开启付费观看</label>
        <div class="vocation">
          <select name="is_pay" class="select3" title="是否开启付费观看">
          <option value="0" <?php echo $video->is_pay == 0 ? 'selected':''?>>否</option>
          <option value="1" <?php echo $video->is_pay == 1 ? 'selected':''?>>是</option>
          </select>
          </div>
        </li>

        <li>
        <label>实际观看付费价格</label>
        <input type="text" title="实际观看付费价格" class="dfinput" style="width:200px;" value="<?php echo $video->present_price ?>" name="present_price" />
        </li>

        <li>
        <label>观看原价</label>
        <input type="text" title="观看原价" class="dfinput" style="width:200px;" value="<?php echo $video->original_price ?>" name="original_price" />
        </li>

        <li>

        <label>开启密码观看</label>
        <div class="vocation">
          <select name="is_password" class="select3" title="开启密码观看">
          <option value="0" <?php echo $video->is_password == 0 ? 'selected':''?>>否</option>
          <option value="1" <?php echo $video->is_password == 1 ? 'selected':''?>>是</option>
          </select>
          </div>
        </li>

        <li>
        <label>密码</label>
        <input type="text" title="密码" class="dfinput" style="width:200px;" value="<?php echo $video->password ?>" name="password" />
        </li>

        <li>
        <label>开启分享免费观看</label>
        <div class="vocation">
          <select name="sharefree_open" class="select3" title="开启分享免费观看">
          <option value="0" <?php echo $video->sharefree_open == 0 ? 'selected':''?>>否</option>
          <option value="1" <?php echo $video->sharefree_open == 1 ? 'selected':''?>>是</option>
          </select>
          </div>
        </li>

        <li>
        <label>分享免费观看时长(单位天)</label>
        <input type="text" title="分享免费观看时长(单位天)" class="dfinput" style="width:200px;" value="<?php echo $video->sharefree_days ?>" name="sharefree_days" />
        </li>

        <li>
        <label>vip等级免费观看</label>

            <?php
            foreach($viplevel as $v){
            ?>
            &nbsp;&nbsp;<div style="display:inline-block;margin-left:-1%">
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input  value="<?php echo $v->id ?>" name="free_viplevelids[]" id="<?php echo 'menu_'.$v->id?>"  type="checkbox"  <?php if(in_array($v['id'],$viparr)){?> checked="checked" <?php }?> class="<?php echo 'parentid_'.$v['id']?>" style="margin-top:1%"/><?php echo $v->title?>
              </div>
          
             <?php }
                  ?>
        
        </li>
        

        <li>
        <label>开启预订</label>
        <div class="vocation">
          <select name="is_order" class="select3" title="开启分享免费观看">
          <option value="0" <?php echo $video->is_order == 0 ? 'selected':''?>>否</option>
          <option value="1" <?php echo $video->is_order == 1 ? 'selected':''?>>是</option>
          </select>
          </div>
        </li>

        <li>
        <label>预订金额</label>
        <input type="text" title="预订金额" class="dfinput" style="width:200px;" value="<?php echo $video->money ?>" name="money" />
        </li>

        <li>
        <label>是否在首页展示</label>
        <div class="vocation">
          <select name="index_show" class="select3" title="是否在首页展示">
          <option value="1" <?php echo $video->index_show == 1 ? 'selected':''?>>是</option>
          <option value="0" <?php echo $video->index_show == 0 ? 'selected':''?>>否</option>
          </select>
          </div>
        </li>

        <li>
        <label>排序</label>
        <input type="text" title="排序" class="dfinput" style="width:200px;" value="<?php echo $video->sort ?>" name="sort" />
        </li>

        <li>
        <label>上下架状态</label>
        <div class="vocation">
          <select name="status" class="select3" title="上下架状态">
          <option value="1" <?php echo $video->status == 1 ? 'selected':''?>>上架</option>
          <option value="0" <?php echo $video->status == 0 ? 'selected':''?>>下架</option>
          </select>
          </div>
        </li>

        <li>
        <label>虚拟销量</label>
        <input type="text" title="虚拟销量" class="dfinput" style="width:200px;" value="<?php echo $video->virtual_sellnum ?>" name="virtual_sellnum" />
        </li>

        <li>
        <label>虚拟参团人数</label>
        <input type="text" title="虚拟参团人数" class="dfinput" style="width:200px;" value="<?php echo $video->virtual_pintuannum ?>" name="virtual_pintuannum" />
        </li>

        <li>
        <label>虚拟在线人数</label>
        <input type="text" title="虚拟在线人数" class="dfinput" style="width:200px;" value="<?php echo $video->inliveuser ?>" name="inliveuser" />
        </li>

        <li>
        <label>浏览量</label>
        <input type="text" title="浏览量" class="dfinput" style="width:200px;" value="<?php echo $video->page_view ?>" name="page_view" />
        </li>

        <li>
        <label>简介</label>
        <textarea class="dfinput" title="简介" name="introduce" style="width:500px; height:90px;"><?php echo $video->introduce;?></textarea>
        </li>

        <li>
        <label>课程难度</label>
        <div class="vocation">
          <select name="difficult_name" class="select3" title="课程难度">
          <option value="" >请选择</option>
          <option value="初级" <?php echo $video->difficult_name == '初级' ? 'selected':''?>>初级</option>
          <option value="中级" <?php echo $video->difficult_name == '中级' ? 'selected':''?>>中级</option>
          <option value="高级" <?php echo $video->difficult_name == '高级' ? 'selected':''?>>高级</option>
          </select>
          </div>
        </li>


        <li>
        <label>分享标题</label>
        <input type="text" title="分享标题" class="dfinput" style="width:200px;" value="<?php echo $video->share_title ?>" name="share_title" />
        </li>


        <li>
        <label>分享图标</label>
        <input type="button" class='jmwup' value="上传文件" id="bshare_ico">
        <script type="text/javascript">
        $('#bshare_ico').upload({
          action: '<?php echo($upload_url) ?>',
          onComplete: function(data) {
            var obj = eval('('+ data +')');
            if(obj.err == '' && obj.msg.url)
            {
              $('#share_ico').val('<?php echo($host) ?>'+obj.msg.url.substr(1));
              alert('上传成功');
            }else{
              alert(obj.err);
            }
          }
        });
        </script>
        <input type="text" title="分享图标" id="share_ico" class="dfinput" style="width:200px;" value="<?php echo $video->share_ico ?>" name="share_ico" />
        </li>

        <li>
        <label>分享描述</label>
        <input type="text" title="分享描述" class="dfinput" style="width:200px;" value="<?php echo $video->share_dec ?>" name="share_dec" />
        </li>


        <li>
        <label>视频详细描述</label>
        </li>
        <li>
        <script id="contnet" style="width: 80%" name="content" type="text/plain"><?php echo $video->content ?></script>
        <script type="text/javascript">
          var ue_contnet = UE.getEditor('contnet');
        </script>
        </li>
        

        <li>
        <label>粉丝团</label>
        </li>
        <li>
        <script id="fans_content" style="width: 80%" name="fans_content" type="text/plain"><?php echo $video->fans_content ?></script>
        <script type="text/javascript">
          var ue_contnet = UE.getEditor('fans_content');
        </script>
        </li>
        

        
  <li><label>&nbsp;</label><input name="" type="submit" class="btn" value="提交"/></li>
    
  
  </form>

</ul></div></div></div></body>
    
    </html>
    
    
